import 'package:architecture/os_size.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:study_demo/ui/main/pages/widgets_example_controller.dart';
import 'package:study_demo/ui/quill/quill_page.dart';
import 'package:study_demo/ui/undo_history/undohistory_page.dart';
import 'package:study_demo/ui/widgets_example/drag_grid_view/drag_grid_view_page.dart';
import 'package:study_demo/ui/widgets_example/flutter_candies/flutter_candies_page.dart';

import '../../../widgets/text_button.dart';
import '../../card_flip/card_flip_page_plus.dart';
import '../../tool/custom_widget/custom_widget_hall_page.dart';
import '../../tool/scatter_diagram/scatter_diagram_page.dart';
import '../../widget/imitate_live_button/imitate_live_button_page.dart';
import '../../widgets_example/animated_tree/animated_tree_page.dart';
import '../../widgets_example/carousel_view/carousel_view_page.dart';
import '../../widgets_example/pinned_header_sliver/pinned_header_sliver_page.dart';
import '../../widgets_example/radar/radar_chart_page.dart';
import '../../widgets_example/roulette_wheel/roulette_wheel_page.dart';
import '../../widgets_example/table_view/infinite_table_page.dart';
import '../../widgets_example/table_view/merged_table_page.dart';
import '../../widgets_example/table_view/simple_table_page.dart';
import '../../widgets_example/tree_view/custom_tree.dart';
import '../../widgets_example/tree_view/simple_tree.dart';

class WidgetsPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GetBuilder<WidgetsExampleController>(
        init: WidgetsExampleController(),
        builder: (controller) {
          return Container(
              margin: EdgeInsets.only(top: 20),
              height: windowHeight,
              child: Wrap(
                  alignment: WrapAlignment.start,
                  crossAxisAlignment: WrapCrossAlignment.start,
                  spacing: 20,
                  runSpacing: 20,
                  children: [
                    MyTextButton(
                      text: "simple_table",
                      confirm: () {
                        Get.to(SimpleTablePage());
                      },
                    ),
                    MyTextButton(
                      text: "infinite_table",
                      confirm: () {
                        Get.to(InfiniteTablePage());
                      },
                    ),
                    MyTextButton(
                      text: "merged_table",
                      confirm: () {
                        Get.to(MergedTablePage());
                      },
                    ),
                    MyTextButton(
                      text: "simple_tree",
                      confirm: () {
                        Get.to(SimpleTreePage());
                      },
                    ),
                    MyTextButton(
                      text: "custom_tree",
                      confirm: () {
                        Get.to(CustomTreePage());
                      },
                    ),
                    MyTextButton(
                      text: "pinned_header_sliver",
                      confirm: () {
                        Get.to(PinnedHeaderSliverPage());
                      },
                    ),
                    MyTextButton(
                      text: "carousel_view",
                      confirm: () {
                        Get.to(CarouselViewPage());
                      },
                    ),
                    MyTextButton(
                      text: "自定义组件",
                      confirm: () {
                        Get.to(CustomWidgetHallPage());
                      },
                    ),
                    MyTextButton(
                      text: "散点图",
                      confirm: () {
                        Get.to(ScatterDiagramPage());
                      },
                    ),
                    MyTextButton(
                      text: "UndoHistory",
                      confirm: () {
                        Get.to(UndoHistoryPage());
                      },
                    ),
                    MyTextButton(
                      text: "flutter_quill",
                      confirm: () {
                        Get.to(QuillPage());
                      },
                    ),
                    MyTextButton(
                      text: "仿进入直播间按钮",
                      confirm: () {
                        Get.to(ImitateLiveButtonPage());
                      },
                    ),
                    MyTextButton(
                      text: "卡片翻转效果",
                      confirm: () {
                        Get.to(FlipCard());
                      },
                    ),
                    MyTextButton(
                      text: "头像旋转和雷达图",
                      confirm: () {
                        Get.to(RadarChartPage());
                      },
                    ),
                    MyTextButton(
                      text: "抽奖转盘",
                      confirm: () {
                        Get.to(RouletteWheelPage());
                      },
                    ),
                    MyTextButton(
                      text: "animated_tree",
                      confirm: () {
                        Get.to(AnimatedTreePage());
                      },
                    ),
                    MyTextButton(
                      text: "fluttercandies",
                      confirm: () {
                        Get.to(flutterCandiesPage());
                      },
                    ),
                    MyTextButton(
                      text: "可拖动排序GridView",
                      confirm: () {
                        Get.to(DragGridViewPage());
                      },
                    ),
                  ]));
        });
  }
}
